'use strict';
module.exports = (app)=>{
    const mongoose = app.mongoose;
    const Schema = mongoose.Schema;
    const PersonSchema = new Schema({
        name: String,   
        minm:String,
        gender:{    // 1 男
            type:String,
            default:"1" 
        },
        parent:{
            type:String,
            default:"-1" 
        },
        level:String,  
        partner:String, // 伴侣
        childs:{
            type:Number,
            default:0
        },
        uid:{ // 被谁创建的
            type: String, 
            required: true
        },
        desc:String,
        born:String,
        order:{
            type:Number,
            default:0
        },
        death:String,
        src: String,  //照片
       },
      { 
        //  timestamps: true 
        timestamps: {
            createdAt: true,
            updatedAt: true,
        }
    });

    return mongoose.model('Person', PersonSchema);
}